<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateNotesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('notes', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('notebook_id')->default(0)->comment('笔记本id');
            $table->char('title', 100)->default('')->comment('标题');
            $table->char('description')->default('')->comment('描述');
            $table->string('keywords')->default('')->comment('关键词');
            $table->mediumText('content', 16777215)->comment('markdown文章内容');
            $table->mediumText('html', 16777215)->comment('markdown转的html页面');
            $table->boolean('status')->default(0)->comment('状态');
            $table->boolean('sort')->default(0)->comment('排序');
            $table->boolean('is_shared')->default(0)->comment('是否共享 1是 0否');
            $table->boolean('is_marked')->default(0)->comment('是否星标 1是 0否');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('notes');
    }
}
